<?php 
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT" ); 
header("Last-Modified: " . gmdate( "D, d M Y H:i:s" ) . "GMT" ); 
header("Cache-Control: no-cache, must-revalidate" ); 
header("Pragma: no-cache" );
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
	<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
	<meta name="author" content="Jeevan" />
    <link rel="stylesheet" media="screen,projection" type="text/css" href="<?=base_url()?>css/style.css" />
    <link rel="stylesheet" media="screen,projection" type="text/css" href="<?=base_url()?>css/content.css" />
    <script src="<?=base_url()?>js/jquery-1.6.4.min.js" type="text/javascript"></script>
    <script src="<?=base_url()?>js/jquery.validate.js" type="text/javascript"></script>
    <script src="<?=base_url()?>js/additional-methods.js" type="text/javascript"></script>
    <script src="<?=base_url()?>js/jquery.validate.messages.js" type="text/javascript"></script>
    <script src="<?=base_url()?>js/fn.js" type="text/javascript"></script>
    <script>
        $(document).ready( function() {
            $(window).resize( function() {
                setWinSize();
            });
            setWinSize();
           
            $("input[type='reset']").click( function() {
                $('label.error').remove();
            });
                    
        });
        
        function setWinSize() {
            $minheight = 500;
            $winheight = $(window).height();
            $topheight = $("#top").height();
            $footerhirght = $("#foot").height();
            $colminheight = $winheight - $topheight - $footerhirght;
            $colminheight = $colminheight - 8; //  Subtract #mid margin
            if($colminheight > $minheight) {
                $("#content").css("height",($colminheight)+"px");  // Subtract #contetn padding    
            } else {
                $("#content").css("height",($minheight)+"px");  // Subtract #contetn padding
            }
        }
        
        function placeError(error, element) {
            var errorplace = element.parent().next();
            error.appendTo(errorplace);
        }        
        
    </script>
	<title><?=lang("login_title"); ?></title>
</head>

<body>

    <div id="main">
    
        <div id="top">
            <div id="title">
                <strong><?=lang("product_name")?></strong> - <?=lang("product_name_2")?>
            </div>
        </div>
        
        <div id="mid">
        <table cellspacing="2" cellpadding="0" border="0" width="100%">
                <tr>
                    <td id="content"> 
                        <div id="contentcontainer">
                            <div class="main">
                                <div id="login">
                                    <form method="post" id="frmlogin" name="frmlogin">
                                        <table>
                                            <? if( isset($errors) ) {
                                               foreach($errors as $error) {
                                               ?>
                                            <tr>
                                                <td class="errormsg" colspan="3">
                                                    <?=$error?>    
                                                </td>
                                            </tr>   
                                               <? 
                                               } 
                                            }  ?>
                                            
                                          <tr>
                                            <td>
                                                <label for="username"><?=lang('user_name')?>*<br />
                                                <span><?=lang('enter_username')?></span></label>
                                            </td>
                                            <td>
                                                <input id="username" name="username" class="text required" />
                                            </td>
                                            <td></td>
                                          </tr>
                                          <tr>
                                            <td>
                                                <label for="password"><?=lang('password')?>*<br />
                                                <span> <?=lang('enter_password')?></span></label>
                                            </td>
                                            <td>
                                                <input id="password" name="password" type="password" class="text required" />
                                            </td>
                                            <td></td>
                                          </tr>                                          
                                          <tr>
                                            <td></td>
                                            <td>
                                                <input class="button" type="submit" name="btnlogin" value="<?=lang('login')?>" id="btnlogin" />
                                                <input class="button" type="reset" value="<?=lang('cancel')?>" id="btnreset" />
                                            </td>
                                            <td></td>
                                          </tr>
                                          <tr>
                                            <td>
                                            </td>
                                            <td>
                                                <input id="rememberme" name="rememberme" type="checkbox" />&nbsp;<label for="rememberme"><?=lang('rememberme')?></label>
                                            </td>
                                            <td></td>
                                          </tr>
                                          <tr>
                                            <td></td>
                                            <td>
                                                <a href="<?=base_url()?>forgotpassword"><?=lang('forgot_password')?></a>
                                            </td>
                                            <td></td>
                                          </tr>
                                        </table>
                                    </form>
                                    <script language="javascript" type="text/javascript">
                                        $(document).ready( function() {
                                            $('#username').trigger('focus');
                                            $("#frmlogin").validate({
                                                errorPlacement: function(error, element) {
                                                    placeError(error, element);
                                                }
                                            });
                                        });
                                    </script>
                                </div>
                            </div>    
                        </div>
                        
                    </td>
                </tr>
            </table>
        </div>
        <div id="foot">
            <p id="copy">&copy; 2011 <a target="_blank" href="http://www.fairdealqatar.com">FairDeal</a>, All Rights Reserved &reg;</p>
        </div>
        
    </div>

</body>
</html>